Simulation 3

Data structure: \(O = (W, A, Y)\)

  • U - exogenous variables
  • W - baseline covariate that is a measure of body condition
  • A - treatment level based on W, continuous between 0 and 5
  • Y - outcome, indicator of an event

Underlying data generating process, \(P_{U,X}\)

  • Exogenous variables:
    • \(U_A \sim Normal(\mu=0, \sigma^2 = 1^2)\)
    • \(U_A \sim Normal(\mu=0, \sigma^2 = 2^2)\)
    • \(U_Y \sim Uniform(min = 0, max = 1)\)
  • Structural equations F and endogenous variables:
    • \(W = U_W\)
    • \(A = bound(2 - 0.5W + U_A, min=0, max=5)\)
    • \(Y = \mathbf{I}[U_Y < expit(-10 - 3W + 4A + \mathbf{I}(A>2) * 5sin((0.8A)^2 - 2.6) )]\)
##        W                   A                Y         
##  Min.   :-3.967412   Min.   :0.0000   Min.   :0.0000  
##  1st Qu.:-0.663312   1st Qu.:0.5975   1st Qu.:0.0000  
##  Median : 0.004786   Median :1.9984   Median :0.0000  
##  Mean   : 0.004627   Mean   :2.1043   Mean   :0.4327  
##  3rd Qu.: 0.694294   3rd Qu.:3.3732   3rd Qu.:1.0000  
##  Max.   : 4.057120   Max.   :5.0000   Max.   :1.0000
## Summary of A given W < -1:
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   0.000   1.454   2.682   2.697   4.033   5.000
## Summary of A given -1 < W <= 0:
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  0.0000  0.8877  2.3048  2.3228  3.6018  5.0000
## Summary of A given 0 < W <= 1:
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##  0.0000  0.3715  1.7676  1.9125  3.1007  5.0000
## Summary of A given 1 < W:
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   0.000   0.000   1.128   1.475   2.474   5.000

n = 200

## [1] "The average fitting time for CV-HAL: 3.7617 seconds"
## [1] "The average fitting time for globally undersmoothed HAL: 6.0892 seconds"
## [1] "The average fitting time for locally undersmoothed HAL: 24.4744 seconds"

n = 500

## [1] "The average fitting time for CV-HAL: 5.9994 seconds"
## [1] "The average fitting time for globally undersmoothed HAL: 14.4206 seconds"
## [1] "The average fitting time for locally undersmoothed HAL: 84.0663 seconds"

n = 1000

## [1] "The average fitting time for CV-HAL: 10.6242 seconds"
## [1] "The average fitting time for globally undersmoothed HAL: 22.6256 seconds"
## [1] "The average fitting time for locally undersmoothed HAL: 113.1588 seconds"